package com.yy.job.boot.service.impl;

import org.apache.commons.lang3.RandomUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.yy.job.core.domain.JobResult;
import com.yy.job.core.domain.JobStepDomain;
import com.yy.job.core.run.process.IJobStepProcess;

@Service("jobTask1")
public class JobTask1 implements IJobStepProcess {
	
	private Logger logger = LoggerFactory.getLogger(this.getClass());

	public JobResult execute(JobStepDomain paramJobTask, String paramT) {
		logger.info("I am in jobTask1, param={}", paramT);
		try {
			Thread.sleep(RandomUtils.nextInt(1, 5)*1000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return JobResult.success();
	}

}
